package com.heima.wemedia.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;

/**
 * @author brianxia
 * @version 1.0
 * @date 2022-11-08 15:52
 */
public class MyPaginationInnerInterceptor extends PaginationInnerInterceptor {

    public MyPaginationInnerInterceptor(DbType dbType) {
        super(dbType);
    }

    @Override
    protected void handlerOverflow(IPage<?> page) {
        //设置为最后一页
        page.setCurrent(page.getPages());
    }
}
